package com.caiyj.strategy;

/**
 * @Description:
 * @author:CAIYJ
 * @Date:2018/12/14 21:28
 */
public class Context {

    Strategy strategy;

    public void setStrategy(Strategy strategy) {
        this.strategy = strategy;
    }

    public int getResult(int[] a) {
        if (null != strategy) {
            return strategy.algorithm(a);
        }
        return 0;
    }
}
